package com.pingbu.tijian.hospital.backapi.api;

import com.github.pagehelper.PageInfo;
import com.pingbu.common.bean.ResultBean;
import com.pingbu.tijian.hospital.backapi.bean.entity.BuzhiZuoye;
import com.pingbu.tijian.hospital.backapi.service.BuzhiZuoyeService;
import com.pingbu.tijian.hospital.backapi.service.UserInfoService;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("/buzhi_zuoye")
public class BuzhiZuoyeController {

    private static Logger logger = LoggerFactory.getLogger(BuzhiZuoyeController.class);

    @Autowired
    private UserInfoService userService;
    @Autowired
    private BuzhiZuoyeService buzhiZuoyeService;

    /**
     *
     * @return
     */
    @PostMapping(value = "/page")
    public ResultBean<PageInfo<BuzhiZuoye>> page(@RequestBody BuzhiZuoye param ) {
        ResultBean<PageInfo<BuzhiZuoye>> rb1 = buzhiZuoyeService.page(param);
        return rb1;
    }

    @PostMapping(value = "/add")
    public ResultBean<Integer> add(@RequestBody BuzhiZuoye param) {
        ResultBean<Integer> rb = buzhiZuoyeService.add(param);
        return rb;
    }

    @PostMapping(value = "/delete")
    public ResultBean<Integer> delete(@RequestBody BuzhiZuoye param) {
        ResultBean<Integer> rb = buzhiZuoyeService.delete(param);
        return rb;
    }

    @PostMapping(value = "/update")
    public ResultBean<Integer> update(@RequestBody BuzhiZuoye param) {
        ResultBean<Integer> rb = buzhiZuoyeService.update(param);
        return rb;
    }

}
